
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[spOwner_InsertOwner]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spOwner_InsertOwner]
GO

GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eric Liew
-- Create date: 6/2/2009
-- Description:	Insert a Owner
-- =============================================
CREATE PROCEDURE [dbo].[spOwner_InsertOwner]
(
	@CompanyName Varchar(100),
	@Title Varchar(50),
	@FirstName Varchar(50),
	@LastName Varchar(50),
	@Street1 Varchar(50),
	@Street2 Varchar(50),
	@Suburb Varchar(50),
	@State Varchar(50),
	@Postcode Varchar(4),
	@Phone Varchar(10),
	@Mobile Varchar(10),
	@ABN Varchar(20)

)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	INSERT Owner
	(
		CompanyName,
		Title,
		FirstName,
		LastName,
		Street1,
		Street2,
		Suburb,
		State,
		Postcode,
		Phone,
		Mobile,
		ABN
	)
	VALUES
	(
		@CompanyName,
		@Title,
		@FirstName,
		@LastName,
		@Street1,
		@Street2,
		@Suburb,
		@State,
		@Postcode,
		@Phone,
		@Mobile,
		@ABN
	) 	

	SELECT @@IDENTITY 
	

 

END
GO
